import { showToast } from 'vant';
import { ref,onMounted } from "vue";
export function page() {
    const loading = ref(false);
    const onRefresh = () => {
      setTimeout(() => {
        localStorage.setItem('dataToPrint', '0');
        loading.value = false;
        window.location.reload();
      }, 1000);
    };
    onMounted(() => {
      if(localStorage.getItem('dataToPrint') !== null) {
        showToast('刷新成功')
        localStorage.removeItem('dataToPrint');
      }
    })
    return{
        onRefresh,
        loading
    }
}